package in.co.codedoc.util;

public class ObjectUtil
{
	public static String toString(Object object)
	{
		if(object == null)
		{
			return "<null>";
		}
		else
		{
			if(object.getClass().isArray())
			{
				StringBuffer buffer = new StringBuffer();
				Object[] array = (Object[])object;
				buffer.append('[');
				for (int i = 0; i < array.length; i++)
				{
					if(i > 0)
					{
						buffer.append(',');
					}
					buffer.append(toString(array[i]));
				}
				buffer.append(']');
				return buffer.toString();
			}
			else
			{
				return object.toString();
			}
		}
	}
}
